<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="yes" name="apple-mobile-web-app-capable" /> 
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<script src="/static/mobile/js/jquery-1.10.2.min.js"></script>
<script src="<?php echo CON_STATIC_URL; ?>js/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="/static/mobile/css/css.css" />
<link type="text/css" rel="stylesheet" href="/static/mobile/css/login.css" />
<link rel="stylesheet" type="text/css" href="/static/mobile/css/layout.css" />
<link rel="stylesheet" type="text/css" href="/static/mobile/css/common.css" />
<title><?php echo CON_WEBNAME;?></title>
<script>
function clearText(input){
	if(input.value=='请输入手机' || input.value=='请输入用户名' || input.value=='请输入验证码'){
		input.value="";
	}
}
function formSubmit(){
	if(document.getElementById("username").value=='请输入用户名'){
		document.getElementById("username").value="";
	}
    if(document.getElementById("phone").value=='请输入手机'){
		document.getElementById("phone").value="";
	}
//	if(document.getElementById("email").value=='请输入邮箱'){
//		document.getElementById("email").value="";
//	}
	document.getElementById("reg_form").submit();
}
</script>
</head>

<body>
<!--头部开始-->
<div class="top">
<!--	<img src="/static/mobile/images/ychapplogo.png">-->
    用户注册
    <a href="javascript:history.go(-1)" class="new-a-back">
    	<span>返回</span>
    </a>
</div>
<!--头部结束-->

<!--主体内容开始-->
<div class="money-list qjys">
	<form id="reg_form" action="/mobile/reg.html" method="post">
	<input type="hidden" name="act" value="reg"/>
	<div class="uesr">
    	<label style="float:left;">用户名</label>
        <input type="text" class="txt1" id="username" name="username" value="请输入用户名" onfocus="clearText(this);"/>
    </div>
    <div class="zl-y">
        <label style="float:left;">手机</label>
        <input type="text" class="txt1" id="phone" name="phone" value="请输入手机" onfocus="clearText(this);"/>
    </div>
<!--    <div class="zl-y">-->
<!--    	<label style="float:left;">邮箱</label>-->
<!--        <input type="text" class="txt1" id="email" name="email" value="请输入邮箱" onfocus="clearText(this);"/>-->
<!--    </div>-->
    <div class="zl-y">
        <label style="float:left;">密码</label>
        <input type="password" class="txt1" name="password" value=""/>
    </div>
    <div class="zl-y">
    	<label style="float:left;">确认密码</label>
        <input type="password" class="txt1" name="password2" value=""/>
    </div>
    <div class="pow">
        <label style="float:left;">验证码</label>
        <input type="text" class="txt1" id="verify_code" style="width: 50%;" name="verify_code" value="请输入验证码" onfocus="clearText(this);"/>
        <a href="javascript:;" onclick="phoneSubmit();" id="phone_code"> 获取验证码</a></span>
    </div>
    <div class="tj">
        <a href="javascript:formSubmit();" class="login" style="float:none; width:100%;">注册</a>
    </div>
    </form>
</div>
<!--主体内容结束-->

<!--底部信息开始-->
<footer class="bottom-nav">
	<ul class="ulnav">
    	<li><a href="/mobile/borrow/index.html"><span class="icon lc"></span>
        <span>我要理财</span>
        </a></li>
    	<li class="active"><a href="/mobile/ucenter/index.html"><span class="icon zh"></span>
        <span>我的账号</span>
        </a></li>
    	<li><a href="/mobile/account/account_list.html"><span class="icon jy"></span>
        <span>交易记录</span>
        </a></li>
    	<li><a href="/mobile/notices/index.html"><span class="icon sm"></span>
        <span>公告说明</span>
        </a></li>
    </ul>
</footer>
<div style="display:none;">
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fbddfbd985badab4bfe8fee07203cc21e' type='text/javascript'%3E%3C/script%3E"));
</script>
<script src="http://s11.cnzz.com/stat.php?id=4565714&web_id=4565714&show=pic" language="JavaScript"></script>
<script>
    function phoneSubmit(){
        if($('#phone').val()=='' || $("#phone").val() == "请输入手机号码"){
            $('#dialog').dialog({
                modal:true, //蒙层（弹出会影响页面大小）
                title:'系统提示',
                buttons:{"确定":function(){$(this).dialog("close");}},
                close: function() {
                }
            });
            alert('请输入手机号码');
            $("#msg").html("请输入手机号码");
            $("#phone").focus();
            return false;
        }else{
            $.ajax({
                type: "post",
                url: "/reg/apply_phone/",
                data: "phone="+$("#phone").val(),
                success: function(ret){
                    //$("#phone_code").html(ret.msg);
                    if(ret.info == 1){
                        phone_countdown();

                    }else{
                        $('#dialog').dialog({
                            modal:true, //蒙层（弹出会影响页面大小）
                            title:'系统提示',
                            buttons:{"确定":function(){$(this).dialog("close");}},
                            close: function() {
                            }
                        });
                        alert(ret.msg);
                        $("#msg").html(ret.msg);
                    }


                },
                dataType: "json"
            });
        }

    }

    function phone_countdown(){
        var count = 60;
        var countdown = setInterval(CountDown, 1000);

        function CountDown() {
            $("#phone_code").html('<font style="color:#000000;">'+count+"</font>秒后重试");
            if (count == 0) {
                $("#phone_code").html('获取验证码');
                clearInterval(countdown);
            }
            count--;
        }

    }
</script>
</div>
<!--底部信息结束-->
</body>
</html>
